import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:yp/config/config.dart';
import 'logic.dart';

import '../../../../helper.dart';

class AccountInvalid2Page extends StatelessWidget {
  final AccountInvalid2Logic logic = Get.put(AccountInvalid2Logic());
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          backgroundColor: Config.mainColor,
          title: Text(
            "账号注销",
            style: TextStyle(
              color: Colors.white,
              fontSize: setWidth(36),
            ),
          ),
          centerTitle: true,
          elevation: 0,
        ),
        backgroundColor: Colors.white,
        body: Padding(
            padding: EdgeInsets.symmetric(
                horizontal: setWidth(30), vertical: setWidth(50)),
            child:
                Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
              Text(
                '请注意，一旦注销账户：',
                style:
                    TextStyle(color: Color(0xff222222), fontSize: setWidth(24)),
              ),
              SizedBox(
                height: setWidth(30),
              ),
              Divider(
                color: Color(0xffeeeeee),
              ),
              _getItem('您的账户7天内无法登录和使用，7天后可重新注册使用'),
              _getItem('身份，账户信息，会员权益将被清空且无法恢复'),
              _getItem('您已获得的积分和优惠券等将会被清空且无法恢复'),
              _getItem('您的储值卡、福利卡余额等将会被清空且无法恢复'),
              _getItem('您已完成的交易将无法处理售后'),
              _getItem('您将无法便捷地查询账号历史交易记录'),
                  _getItem('您的账号与绑定的微信将会自动解除关联'),
              SizedBox(
                height: setWidth(50),
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: [
                  InkWell(
                    onTap: () => logic.sure(),
                    child: Container(
                      height: setWidth(90),
                      width: setWidth(252),
                      alignment: Alignment.center,
                      decoration: BoxDecoration(
                          color: Colors.white,
                          border: Border.all(color: Config.mainColor),
                          borderRadius: BorderRadius.circular(setWidth(45))),
                      child: Text(
                        '确认注销',
                        style: TextStyle(
                            color: Config.mainColor, fontSize: setWidth(36)),
                      ),
                    ),
                  ),
                  InkWell(
                    onTap: () {
                      Get.back();
                    },
                    child: Container(
                      height: setWidth(90),
                      width: setWidth(252),
                      alignment: Alignment.center,
                      decoration: BoxDecoration(
                          color: Config.mainColor,
                          borderRadius: BorderRadius.circular(setWidth(45))),
                      child: Text(
                        '不注销了',
                        style: TextStyle(
                            color: Colors.white, fontSize: setWidth(36)),
                      ),
                    ),
                  )
                ],
              )
            ])));
  }

  Widget _getItem(String text) {
    return Container(
      constraints: BoxConstraints(minHeight: setWidth(80)),
      alignment: Alignment.centerLeft,
      child: Row(
        children: [
          Container(
            width: setWidth(12),
            height: setWidth(12),
            decoration: BoxDecoration(
                color: Config.mainColor,
                borderRadius: BorderRadius.circular(setWidth(6))),
          ),
          SizedBox(
            width: setWidth(10),
          ),
          Text(
            text,
            style: TextStyle(color: Color(0xff999999), fontSize: setWidth(24)),
          )
        ],
      ),
    );
  }
}
